<div class="layui-layout layui-layout-content">
	<div class="layui-side layui-bg-black">
		<div class="layui-side-scroll">
		<#include "/apps/setting/include/left.html"/></div>
	</div>
	<div class="layui-body">
		<div class="layui-side-scroll">
			<form method="post" key="set-mine" enctype="multipart/form-data" action="/setting/agent/sessionconfig/save.html" class="layui-form">
				<#if sessionConfig??><input type="hidden" name="id" value="${sessionConfig.id!''}"></#if>
				<div class="row">
					<div class="col-lg-12">
						<div class="ukefu-customer-div setting-wrapper">
							<div class="box default-box">
								<div class="box-header">
									<h3 class="box-title">对话设置</h3>
								</div>
								<div class="box-body ukefu-im-theme">
									<div class="row">
										<div class="col-lg-8">
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">1、人工坐席接入欢迎消息</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-12">
															<textarea name="sessionmsg" id="sessionmsg" autocomplete="off" class="layui-input" resize="false" style="height:90px;line-height:22px;resize: none;"><#if sessionConfig?? && sessionConfig.sessionmsg??>${sessionConfig.sessionmsg}<#else>欢迎您来咨询！所有客户均可以免费注册试用，有关技术支持和商业咨询可以申请加入我们官方QQ群：555834343.</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">2、坐席分配策略</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>新客户接入人工坐席的分配策略</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">空闲坐席优先：新客户接入人工坐席的时候，优先分配给对话数量最少的坐席</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">坐席平均分配：按照坐席轮流分配给未达到最大对话数量的坐席</p>
														</div>
														<div class="col-lg-4">
															<select name="distribution">
															  	<option value="0" <#if !(sessionConfig??) || !(sessionConfig.distribution??) || (sessionConfig?? && sessionConfig.distribution?? && sessionConfig.distribution == '0')>selected="selected"</#if>>空闲坐席优先</option>
															  	<option value="1" <#if sessionConfig?? && sessionConfig.distribution?? && sessionConfig.distribution == '1'>selected="selected"</#if>>坐席平均分配</option>
															</select>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">2、坐席分配最大访客数量</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>为每个人工坐席分配访客的最大数量</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">分配过多用户会导致客户满意度降低</p>
														</div>
														<div class="col-lg-4">
															<select name="maxuser">
																<option value="1" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 1>selected="selected"</#if>>1</option>
																<option value="2" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 2>selected="selected"</#if>>2</option>
																<option value="3" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 3>selected="selected"</#if>>3</option>
																<option value="4" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 4>selected="selected"</#if>>4</option>
															  	<option value="5" <#if !(sessionConfig??) || !(sessionConfig.distribution??) || (sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 0)>selected="selected"</#if>>5</option>
															  	<option value="10" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 10>selected="selected"</#if>>10</option>
															  	<option value="15" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 15>selected="selected"</#if>>15</option>
															  	<option value="20" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 20>selected="selected"</#if>>20</option>
															  	<option value="30" <#if sessionConfig?? && sessionConfig.maxuser?? && sessionConfig.maxuser == 30>selected="selected"</#if>>30</option>
															</select>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">3、历史服务坐席优先分配</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，客户接入坐席的时候，会优先分配一起通话过的坐席进行分配</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">如果分配的坐席已达到最大服务用户数，则进入等待队列</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" id="lastagent" name="lastagent" title="启用" <#if sessionConfig?? && sessionConfig.lastagent == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">4、客户超时提醒</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>客户与坐席对话的超时提醒功能</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">开启后，用户在指定时间内没有响应时，系统会自动结束对话</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="启用" name="sessiontimeout" id="sessiontimeout" lay-filter="timeout" <#if sessionConfig?? && sessionConfig.sessiontimeout == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="timeout_tip" style="<#if sessionConfig?? && sessionConfig.sessiontimeout == false>display:none;</#if>">	
													<div class="row">
														<div class="col-lg-8">
															<p>超时时长（秒）</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="timeout" id="timeout" lay-verify="number" value="<#if sessionConfig?? && sessionConfig.timeout gt 0>${sessionConfig.timeout}<#else>120</#if>" autocomplete="off" class="layui-input" style="width:80px;display:inline;">
														</div>
													</div>
													<div class="row">
														<div class="col-lg-8">
															<p>超时提示消息</p>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-12">
															<textarea name="timeoutmsg" id="timeoutmsg" autocomplete="off" class="layui-input" resize="false" style="height:90px;line-height:22px;resize: none;"><#if sessionConfig?? && sessionConfig.sessionmsg??>${sessionConfig.sessionmsg}<#else>您好，您已经很长时间没有发送消息了，您是否还在线？</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">5、客户超时提醒后再次超时</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>客户与坐席对话超时后再次超时后出策略</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">开启后，用户在指定时间内没有响应时，系统会在2分钟后自动结束对话，</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="启用" id="resessiontimeout" name="resessiontimeout" lay-filter="retimeout" <#if sessionConfig?? && sessionConfig.resessiontimeout == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="re_timeout_tip" style="<#if sessionConfig?? && sessionConfig.resessiontimeout == false>display:none;</#if>">	
													<div class="row">
														<div class="col-lg-8">
															<p>提醒后再次超时时长（秒）</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="retimeout" lay-verify="number" id="retimeout" value="<#if sessionConfig?? && sessionConfig.retimeout gt 0 >${sessionConfig.retimeout}</#if>" autocomplete="off" class="layui-input" style="width:80px;display:inline;">
														</div>
													</div>
													<div class="row">
														<div class="col-lg-8">
															<p>提醒后再次超时后断开的提示消息</p>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-12">
															<textarea name="retimeoutmsg" id="retimeoutmsg" autocomplete="off" class="layui-input" resize="false" style="height:90px;line-height:22px;resize: none;"><#if sessionConfig?? && sessionConfig.sessionmsg??>${sessionConfig.sessionmsg}<#else>您好，欢迎下次咨询，再见？</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">6、坐席回复超时</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>坐席回复客户消息的超时自动回复功能</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">开启后，坐席在指定时间内没有回复消息时，系统会自动回复用户消息</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="启用" name="agentreplaytimeout" id="agentreplaytimeout" lay-filter="agentreplaytimeout" <#if sessionConfig?? && sessionConfig.agentreplaytimeout == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
												<div class="box-item" id="agentreplay" style="<#if sessionConfig?? && sessionConfig.agentreplaytimeout == false>display:none;</#if>">	
													<div class="row">
														<div class="col-lg-8">
															<p>超时时长（秒）</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="text" name="agenttimeout" lay-verify="number" id="agenttimeout" value="<#if sessionConfig?? && sessionConfig.agenttimeout gt 0>${sessionConfig.agenttimeout}<#else>120</#if>" autocomplete="off" class="layui-input" style="width:80px;display:inline;">
														</div>
													</div>
													<div class="row">
														<div class="col-lg-8">
															<p>超时提示消息</p>
														</div>
													</div>
													<div class="row" style="margin-top:10px;">
														<div class="col-lg-12">
															<textarea name="agenttimeoutmsg" id="agenttimeoutmsg" autocomplete="off" class="layui-input" resize="false" style="height:90px;line-height:22px;resize: none;"><#if sessionConfig?? && sessionConfig.agenttimeoutmsg??>${sessionConfig.agenttimeoutmsg}<#else>欢迎咨询，我正在为您查询资料？</#if></textarea>
														</div>
													</div>
												</div>
											</div>
											
											
											<div class="ukefu-webim-prop">
												<div class="ukefu-webim-tl" style="clear:both;">7、启用满意度调查</div>
												<div class="box-item">
													<div class="row">
														<div class="col-lg-8">
															<p>启用此功能后，客户在结束对话的时候，提示选择满意度</p>
															<p style="color:#888888;font-size:13px;margin-top:10px;">满意度调查功能，所有实时渠道适用（WebIM，微信）</p>
														</div>
														<div class="col-lg-4" style="text-align:right;">
															<input type="checkbox" title="启用" name="satisfaction" id="satisfaction" <#if sessionConfig?? && sessionConfig.satisfaction == true>checked="checked"</#if>>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-lg-3"></div>
					<div class="col-lg-9">
						<div class="layui-form-item">
						  <div class="layui-input-block">
							<button class="layui-btn" lay-submit="" lay-filter="formDemo">保存</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						  </div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

<script language="javascript"> 		
	layui.use('form', function(){
		var form = layui.form();
		form.render('select'); //刷新select选择框渲染
		form.on("checkbox(timeout)" , function(data){
			if(data.elem.checked == true){
				$('#timeout_tip').show();		
			}else{
				$('#timeout_tip').hide();
			}
		});
		form.on("checkbox(retimeout)" , function(data){
			if(data.elem.checked == true){
				$('#re_timeout_tip').show();		
			}else{
				$('#re_timeout_tip').hide();
			}
		});
		form.on("checkbox(agentreplaytimeout)" , function(data){
			if(data.elem.checked == true){
				$('#agentreplay').show();		
			}else{
				$('#agentreplay').hide();
			}
		});
	});
			
</script>